﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace odinshrine
{
    class Menu
    {
        /*POUR RAJOUTER QUELQUE CHOSE DANS LE MENU BIEN REGARDER LES LIENS ENTRE TOUS LES MENUS
         ET CHANGER DANS GESTION_SOURIS ET GESTION_CLAVIER*/
        protected static bool menu_options = false;
        protected static bool menu_commandes = false;
        protected static bool menu_son = false;
        public static bool menu_on = true; // true: affiche le menu | false: affiche le jeu
        public static TimeSpan timer_souris = TimeSpan.Zero;
        protected static int delaiSouris = 100;
        public static bool clavierUpup = true;
        public static bool clavierUpdown = false;

        public void Load(ContentManager Content)
        {
            Mainmenu.initmainMenu(Content);
            Options.initOptions(Content);
            Commandes.LoadCommandes(Content);
            MenuSon.LoadMenuSon(Content);
        }
        public void Gestion(MouseState mouse, KeyboardState clavier, Game1 game, GameTime gameTime)
        {
            Mainmenu.Gestion(mouse, game, gameTime, clavier);
            Options.Gestion(clavier, mouse.X, mouse.Y, mouse);
            Commandes.Gestion(gameTime, clavier);
            if (Menu.menu_son)
            {
                MenuSon.Gestion(mouse, clavier, gameTime);
            }
            if (!menu_options || menu_commandes || menu_son)
            {
                Options.placeOptions = 0;
            }
        }
        public void Draw(SpriteBatch spriteBatch, MouseState mouse)
        {
            if (Menu.menu_on)
            {
                Mainmenu.drawmainMenu(spriteBatch, mouse.X, mouse.Y);
            }
            if (menu_options)
            {
                Options.drawOptions(spriteBatch, mouse.X, mouse.Y);
            }
            if (menu_commandes)
            {
                Commandes.Draw(spriteBatch);
            }
            if (menu_son)
            {
               MenuSon.DrawSon(spriteBatch, mouse);
            }
        }
    }
}
